<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.js"></script>
    <link rel="stylesheet" href="css/sui-append.min.css">
    <link rel="stylesheet" href="css/sui.min.css">
    <script src="js/sui.min.js"></script>

</head>
<body>
<button id="J_addsuppliers" data-toggle="modal" data-target="#J_addsuppliersDialog" data-width="large"
        data-backdrop="static" class="sui-btn btn-primary">添加供应商
</button>
<div id="J_addsuppliersDialog" tabindex="-1" role="dialog" class="sui-modal hide fade" data-addsupplierurl="http://"
     data-getsuppliersurl="http://xxx">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" data-dismiss="modal" aria-hidden="true" class="sui-close">×</button>
                <h4 id="myModalLabel" class="modal-title">供应商收编</h4>
            </div>
            <div class="modal-body sui-form form-horizontal">
                <div class="sui-msg msg-block msg-default msg-tips">
                    <div class="msg-con">以下为供销平台上已经获得小二授权经营您的品牌但还未被您进行收编的供应商</div>
                    <s class="msg-icon"></s>
                </div>
                <table class="sui-table table-bordered-simple">
                    <tr>
                        <td>供应商昵称</td><td><span> <input id="a" type="text" placeholder=".input-info" class="input-info"></span></td>
                    </tr>
                    <tr>
                        <td>公司名称</td><td><span> <input type="text" id="b" placeholder=".input-info" class="input-info"></span></td>
                    </tr>
                    <tr>
                        <td>供应商类型</td> <td><span> <input type="text" id="c" placeholder=".input-info" class="input-info"></span></td>
                    </tr>
                    <tr>
                        <td>分销商数量</td> <td><span> <input type="text" id="d" placeholder=".input-info" class="input-info"></span></td>
                    </tr>
                    <tr>
                        <td>授权品牌</td><td><span> <input type="text" id="e" placeholder=".input-info" class="input-info"></span></td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center">
                            <button class="sui-btn btn-small J_addOneSupplier">添加</button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
<script>
    $supDialog = $('#J_addsuppliersDialog')
    $supDialog.on('click', '.J_addOneSupplier', function (e) {
        $supDialog.modal('shadeIn');
        return $.confirm({
            title: '确认',
            body: '您确认添加该供应商吗？',
            backdrop: false,
            okHide: function () {
               $.ajax({
                   url:'/getData',
                   dataType:'JSON',
                   data:{
                       'a':$('#a').val(),
                       'b':$('#b').val(),
                       'c':$('#c').val(),
                       'd':$('#d').val(),
                       'e':$('#e').val(),
                   },
                   success:function () {

                   },
                   error:function () {
                       console.log($('#a').val())
                   }
               })
            },
            hide: function () {
                return $supDialog.modal('shadeOut');
            }
        });
    });


</script>
</body>
</html>